﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

using DotNet.Entity;
using System.ComponentModel.DataAnnotations;

namespace DotNet.JCore.Entity
{
    /// <summary>
    /// 人工稽查登记
    /// </summary>
    [Table("人工稽查登记")]
    public class ManualReg
    {
        /// <summary>
        /// 主键
        /// </summary>
        [PrimaryKey]
        [Column("主键", false)]
        public string Id { get; set; }
        /// <summary>
        /// 车牌号
        /// </summary>
        [Column("车牌号")]
        [MaxLength(7, ErrorMessage = "车牌号长度不能超过7个字符")]
        [RegularExpression("^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z]{1}[A-Z]{1}[A-Z0-9]{4}[A-Z0-9挂学警港澳]{1}$", ErrorMessage = "请输入正确的车牌号")]
        public string CarNumber { get; set; }
        /// <summary>
        /// 线路
        /// </summary>
        [Column("线路")]
        [MaxLength(200, ErrorMessage = "线路长度不能超过200个字符")]
        public string Line { get; set; }
        /// <summary>
        /// 所属客运站
        /// </summary>
        [Column("所属客运站", false)]
        [MaxLength(50, ErrorMessage = "所属客运站长度不能超过50个字符")]
        public string Station { get; set; }
        /// <summary>
        /// 客运站名称
        /// </summary>
        [Column("所属客运站")]
        public string StationName { get; set; }
        /// <summary>
        /// 稽查点名称
        /// </summary>
        [Column("稽查点名称")]
        public string PointName { get; set; }
        /// <summary>
        /// 乘客人数
        /// </summary>
        [Column("出站人数(人)")]
        [MaxLength(5, ErrorMessage = "出站人数长度不能超过5个字符")]
        [RegularExpression("^[0-9]*$", ErrorMessage = "出站人数请输入正确的格式")]
        public string ExitNumber { get; set; }
        /// <summary>
        /// 乘客人数
        /// </summary>
        [Column("乘客人数(人)")]
        [MaxLength(5, ErrorMessage = "乘客人数长度不能超过5个字符")]
        [RegularExpression("^[0-9]*$", ErrorMessage = "乘客人数请输入正确的格式")]
        public string PassengerNumber { get; set; }
        /// <summary>
        /// 司机姓名
        /// </summary>
        [Column("司机姓名")]
        [MaxLength(20, ErrorMessage = "司机姓名长度不能超过20个字符")]
        public string DriverName { get; set; }
        /// <summary>
        /// 司机电话
        /// </summary>
        [Column("联系电话")]
        [MaxLength(11, ErrorMessage = "司机电话长度不能超过11个字符")]
        [RegularExpression("^1[0-9]{10}$", ErrorMessage = "请输入正确的司机电话")]
        public string DriverPhone { get; set; }
        /// <summary>
        /// 运输企业
        /// </summary>
        [Column("运输企业")]
        [MaxLength(50, ErrorMessage = "运输企业长度不能超过50个字符")]
        public string Corp { get; set; }
        /// <summary>
        /// 0：正常1：违规
        /// </summary>
        /// 
        [Column("稽查状态",false)]
        public int CheckStatus { get; set; }
        /// <summary>
        /// 稽查状态名称
        /// </summary>
        [Column("稽查状态")]
        public string CheckStatusName { get; set; }
        /// <summary>
        /// 违规类型名称
        /// </summary>
        [Column("违规内容")]
        public string OffenceName { get; set; }
        /// <summary>
        /// 处理结果名称
        /// </summary>
        [Column("处理结果")]
        public string ProcessStatusName { get; set; }
        /// <summary>
        /// 创建时间
        /// </summary>
        [Column("登记时间")]
        public DateTime CreateTime { get; set; }
        /// <summary>
        /// 创建者姓名
        /// </summary>
        [Column("登记人")]
        public string CreateName { get; set; }
        /// <summary>
        /// 0：正常1：违规
        /// </summary>
        [Ignore]
        [Column("0：正常1：违规", false)]
        public bool RGCheckStatus { get { return CheckStatus == 1; } }
        /// <summary>
        /// 0：未处理1：已处理
        /// </summary>
        [Column("0：未处理1：已处理", false)]
        public int ProcessStatus { get; set; }
        /// <summary>
        /// 0：未处理1：已处理
        /// </summary>
        [Ignore]
        [Column("0：未处理1：已处理", false)]
        public bool RGProcessStatus { get { return ProcessStatus == 1; } }
        /// <summary>
        /// 0：人数不符1：时间不符2：未经过检查点3：资质不符4：其他
        /// </summary>
        [Column("0：人数不符1：时间不符2：未经过检查点3：资质不符4：其他", false)]
        public string OffenceId { get; set; }
        /// <summary>
        /// 稽查点主键
        /// </summary>
        [Column("稽查点主键", false)]
        public string PointId { get; set; }
        /// <summary>
        /// 有效
        /// </summary>
        [Column("有效", false)]
        public bool Enabled { get; set; }
        /// <summary>
        /// 有效状态 0无效 1有效
        /// </summary>
        //[Column("状态", false)]
        //public string EnabledText
        //{
        //    get { return Enabled ? "有效" : "无效"; }
        //}
        /// <summary>
        /// 创建者主键
        /// </summary>
        /// 
        [Column("创建者主键", false)]
        public string CreateId { get; set; }
        /// <summary>
        /// 备注
        /// </summary>
        /// 
        [Column("备注")]
        [MaxLength(200, ErrorMessage = "备注不能超过200个字符")]
        public string Note { get; set; }

        [Ignore]
        [Column("行号", false)]
        public string RowNumber { get; set; }
        
        /// <summary>
        /// 复制对象
        /// </summary>
        public ManualReg Clone()
        {
            return (ManualReg)MemberwiseClone();
        }
    }
}


